﻿<UserControl x:Class="theeg.MatrixWpf.MatrixControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:models="clr-namespace:theeg.MatrixWpf.Models"
             xmlns:matrix="clr-namespace:theeg.MatrixWpf"
             mc:Ignorable="d" 
             d:DesignHeight="600" d:DesignWidth="600">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Rectangle></Rectangle>
        <Rectangle Grid.Column="0" Grid.Row="1" Fill="HotPink" Width="60"></Rectangle>
        <Rectangle Grid.Column="1" Grid.Row="0" Fill="lime" Height="60"></Rectangle>
        <ItemsControl Grid.Column="0" Grid.Row="1" ItemsSource="{Binding Elements, RelativeSource={RelativeSource AncestorType={x:Type matrix:MatrixControl}}}">
            <ItemsControl.ItemTemplate>
                <DataTemplate DataType="{x:Type models:Element}">
                    <TextBlock Text="{Binding Text}"></TextBlock>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>

        <Border x:Name="Viewport" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#01000000"
                SizeChanged="ViewportSizeChanged" PreviewMouseDown="ViewportPreviewMouseDown" MouseMove="ViewportMouseMove">
            <Canvas x:Name="MatrixPanel" HorizontalAlignment="Center" VerticalAlignment="Center">
            </Canvas>
        </Border>
        <ScrollBar x:Name="VerticalScrollBar" Grid.Column="2" Grid.Row="1" Orientation="Vertical"></ScrollBar>
        <ScrollBar x:Name="HorizontalScrollBar" Grid.Column="1" Grid.Row="2" Orientation="Horizontal"></ScrollBar>
    </Grid>
</UserControl>
